package com.kingyun.gpsinspection.purificationservice.dao.mapper.som;


import com.kingyun.gpsinspection.purificationservice.facade.model.som.WorkOrder;
import com.kingyun.gpsinspection.purificationservice.facade.model.tdm.WorkOrderVo;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 工单mapper
 */
public interface WorkOrderMapper {

    /**
     * 查询当日工单列表
     * @param workOrder
     * @return
     */
    List<WorkOrder> queryList(WorkOrder workOrder);

    /**
     * 查询遗留工单列表
     *
     * @param workOrder
     * @return
     */
    List<WorkOrder> queryUnfinishList(WorkOrder workOrder);

    /**
     * 查询工单台帐列表
     *
     * @param workOrder
     * @return
     */
    List<WorkOrder> queryOrderList(WorkOrder workOrder);

    /**
     * 查询作业条件准备工单列表
     *
     * @param workOrder
     * @return
     */
    List<WorkOrder> queryOpcList(WorkOrder workOrder);

    /**
     * 查询作业条件确认工单列表
     *
     * @param workOrder
     * @return
     */
    List<WorkOrder> querySureList(WorkOrder workOrder);

    /**
     * 统计遗留工单总数
     *
     * @param workOrder
     * @return
     */
    Integer queryUnfinishCount(WorkOrder workOrder);

    /**
     * 统计当日工单总数
     *
     * @param workOrder
     * @return
     */
    Integer queryCount(WorkOrder workOrder);

    /**
     * 统计工单台帐总数
     *
     * @param workOrder
     * @return
     */
    Integer queryOrderCount(WorkOrder workOrder);

    /**
     * 统计作业条件准备工单总数
     *
     * @param workOrder
     * @return
     */
    Integer queryOpcCount(WorkOrder workOrder);

    /**
     * 统计作业条件确认工单总数
     *
     * @param workOrder
     * @return
     */
    Integer querySureCount(WorkOrder workOrder);

    /**
     * 根据id查询工单
     *
     * @param workOrderId
     * @return
     */
    WorkOrder queryById(String workOrderId);

    /**
     * 根据id更新操作时间
     *
     * @param workOrderId
     * @return
     */
    Integer updateTimeById(String workOrderId);

    /**
     * 根据工作内容id查询工单
     *
     * @param workInstanceId
     * @return
     */
    List<WorkOrder> queryByWorkInstanceId(String workInstanceId);

    /**
     * 根据查询条件查询工单
     *
     * @param map
     * @return
     */
    List<WorkOrder> selectByOther(HashMap<Object, Object> map);

    /**
     * 更新是否可以完成状态
     *
     * @param map
     * @return
     */
    int updateCanFinish(Map map);

    /**
     * 更新状态
     *
     * @param map
     * @return
     */
    int updateStatus(Map map);

    /**
     * 根据时间查询所有符合条件的工单
     *
     * @param map
     * @return
     */
    List<WorkOrder> selectByTi(HashMap<Object, Object> map);

    /**
     * 根据工单ID查询
     *
     * @param workOrderId
     * @return
     */
    WorkOrder selectById(String workOrderId);

    /**
     * 根据时间查询工单
     *
     * @param map
     * @return
     */
    List<WorkOrder> selectByDay(HashMap<Object, Object> map);

    /**
     * 插入调整申请
     *
     * @param map
     * @return
     */
    int insertApply(Map map);

    /**
     * 更新工单信息
     *
     * @param workOrder
     * @return
     */
    int updateWorkOrder(WorkOrder workOrder);

    /**
     * 更新工单状态
     *
     * @param map
     * @return
     */
    int updateSataus(Map map);

    /**
     * 工单统计-工单列表
     *
     * @param workOrder
     * @return
     */
    List<WorkOrder> countData(WorkOrder workOrder);

    /**
     * 工单统计-工单列表当前页数量
     *
     * @param workOrder
     * @return
     */
    int countDataCount(WorkOrder workOrder);

    /**
     * 通过多个id查询工单
     *
     * @param idList 工单idlist
     */
    List<WorkOrderVo> queryWorkOrderByIds(List<String> idList);

    /**
     * 获取工单执行人
     * @param workOrderId
     * @return
     */
    String getOrderUser(String workOrderId);
}